package com.partsoft.dits.ldap;

import org.springframework.ldap.core.ContextSource;


public interface LdapContextSourceProvider {

	/**
	 * 获得Ldap上下文池
	 * 
	 * @param desc
	 * @return
	 * @throws RuntimeException
	 *             如果找不到则抛出异常
	 */
	ContextSource getLdapContextSource(LdapContextDescriptor desc) throws RuntimeException;

	/**
	 * 获得Ldap上下文池
	 * @param id
	 * @return
	 * @throws RuntimeException
	 *             如果找不到则抛出异常
	 */
	ContextSource getLdapContextSource(String id) throws RuntimeException;

	/**
	 * 判断是否有此Ldap上下文池
	 * @param desc
	 * @return
	 */
	boolean hasLdapContextSource(LdapContextDescriptor desc);

	/**
	 * 判断是否有此Ldap上下文池
	 * @param id
	 * @return
	 */
	boolean hasLdapContextSource(String id);

}
